
// 创建根
import { createApp } from 'vue'
//引入pinia仓库
import pinia from './stores'
//element ui组件库
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'
//引入app
import App from './App.vue'
//引入路由
import router from './router'
// 全局样式
import './styles/index.scss'
//ELSvg它是一个函数:调用，传递app应用对象
//将element-plus里面图标变为全局组件
import ElSvg from './components/SvgIcon/ElSvg'
//全局路由守卫判断
import './permission'
const app = createApp(App)

//注册category全局组件
import category from './components/Categroy/index.vue'
app.component('Category', category)

//按钮权限全局自定义指令封装
import has from '@/utils/has'
// 传入app
has(app)

//引入mock
import '@/mock/index'

//引入echarts
import 'echarts'
import ECharts from 'vue-echarts'
app.component('VueEcharts', ECharts)

// 传入app 设置全局组件icon图标
ElSvg(app)
app.use(pinia)
  .use(router)
  .use(ElementPlus, {
    locale: zhCn,
  })
  .mount('#app')
